package com.ds.infrastructure.hyperspace.console.entity.enums;

public interface TbReleaseNodeEnum {
    /**
     * 安装状态
     */
    enum INSTALL_STATE {
        INIT(1, "初始化"),
        SUCCESS(2, "成功"),
        FAIL(3, "失败");

        public final Integer code;
        private final String desc;

        INSTALL_STATE(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static INSTALL_STATE toEnum(int value) {
            for (INSTALL_STATE item : INSTALL_STATE.values()) {
                if (item.code == value) {
                    return item;
                }
            }
            return null;
        }
    }

    /**
     * 推送状态
     */
    enum PUSH_STATE {
        INIT(1, "初始化"),
        SUCCESS(2, "成功"),
        FAIL(3, "失败");

        public final Integer code;
        private final String desc;

        PUSH_STATE(Integer code, String desc) {
            this.code = code;
            this.desc = desc;
        }

        public static PUSH_STATE toEnum(int value) {
            for (PUSH_STATE item : PUSH_STATE.values()) {
                if (item.code == value) {
                    return item;
                }
            }
            return null;
        }
    }
}
